package com.moniteach.bo;

import java.util.Date;

import org.json.JSONException;
import org.json.JSONObject;

import com.moniteach.constaints.C;

public class Message {

	private String id;
	private String theme;
	private String text;
	private String dateCreate;
	private String sender;
	private String receiver;

	public Message(String id, String theme, String text, String dateCreate,
			String sender, String receiver) {
		super();
		this.id = id;
		this.theme = theme;
		this.text = text;
		this.dateCreate = dateCreate;
		this.sender = sender;
		this.receiver = receiver;
	}

	public Message(JSONObject jo) {
		try {
//			this.id = String.valueOf(jo.getLong(Resource.string.id));
			this.id = "0";
			this.theme = jo.getString(C.Const.theme);
			this.text = jo.getString(C.Const.text);
			this.dateCreate = jo.getString(C.Const.dateCreate);
			this.sender = String.valueOf(jo.getLong(C.Const.sender));
			this.receiver = String.valueOf(jo.getLong(C.Const.receiver));
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTheme() {
		return theme;
	}

	public void setTheme(String theme) {
		this.theme = theme;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getDateCreate() {
		return dateCreate;
	}

	public void setDateCreate(String dateCreate) {
		this.dateCreate = dateCreate;
	}

	public String getSender() {
		return sender;
	}

	public void setSender(String sender) {
		this.sender = sender;
	}

	public String getReceiver() {
		return receiver;
	}

	public void setReceiver(String receiver) {
		this.receiver = receiver;
	}

}
